package com.heima.admin.controller.v1;

import com.heima.admin.service.AdminLoginService;
import com.heima.model.admin.dtos.AdUserDto;
import com.heima.model.common.dtos.ResponseResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 管理员登录接口
 */
@RestController
@Slf4j
@RequestMapping("/login")
public class AdminLoginController {

    @Autowired
    private AdminLoginService adminLoginService;

    @PostMapping("/in")
    public ResponseResult login(@RequestBody AdUserDto adUserDto) {
        log.info("【管理员登录】");
        return adminLoginService.login(adUserDto);
    }
}
